export function toUpperCase(str) {
  return str.replace(/\b[a-z]/g, char => char.toUpperCase())
}

export function uuid() {
  return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function(c) {
    return (c ^ window.crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16)
  })
}

export function parseCookie(cookies,name) {
  var cookie = ''
  Object.keys(cookies).forEach(item => {
  	if(item === name){
  		cookie =  cookies[item]
  	}
  })
  return cookie
}	
export	function getCookie(name){
	    var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
//	    if(arr=document.cookie.match(reg)){
//	        return unescape(arr[2]);
//	    }else{
//	    	return null
//	    }
			return '39b77f34-a1c3-4eb2-912e-f666a7330d2b'
	}
	
export	function removeCookie(name) { 
        document.cookie=name+"="+''+"; expire="+(new Date(0).toGMTString())+"; path=/; domain=.1234tv.com";
	}
export	function IsPC() {
	    var userAgentInfo = navigator.userAgent;
	    var Agents = ["Android", "iPhone",
	                "SymbianOS", "Windows Phone",
	                "iPad", "iPod"];
	    var flag = true;
	    for (var v = 0; v < Agents.length; v++) {
	        if (userAgentInfo.indexOf(Agents[v]) > 0) {
	            flag = false;
	            break;
	        }
	    }
	    return flag;
	}	
export	function getQueryString(name) {
	    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
	    var r = window.location.search.substr(1).match(reg);
	    if (r != null) {
	        return unescape(r[2]);
	    }
	    return null;
	}